#include <iostream>
#include <stdio.h>
using namespace std;
typedef long long ll;
const ll MOD= 998244353;
ll Kuai(ll a) {
	ll mdzz[2][2]={{1,1},{1,0}};
	ll res[2][2]={{1,0},{0,1}};
	ll res1[2][2];
	ll ask=a-1;
	while (ask) {
		if (ask&1) {
			for (int i=0; i<2; ++i) {
				for (int j=0; j<2; ++j) {
					res1[i][j]=0;
					for (int k=0; k<2; ++k) {
						res1[i][j]=(res1[i][j]+res[i][k]*mdzz[k][j])%MOD;
					}
				}
			}
			swap(res,res1);
		}
		for (int i=0; i<2; ++i) {
			for (int j=0; j<2; ++j) {
				res1[i][j]=0;
				for (int k=0; k<2; ++k) {
					res1[i][j]=(res1[i][j]+mdzz[i][k]*mdzz[k][j])%MOD;
				}
			}
		}
		swap(res1,mdzz);
		ask=(ask>>1);
	}
	if (res[0][0]<0) res[0][0]+=MOD;
	return res[0][0]%MOD;
}
int main() {
	ll ask;
	ll res;
	while (cin>>ask) {
		res=Kuai(3+2*ask)-1;
		if (res<0) res+=MOD;
		cout<<res<<endl; 
	}
	return 0;
}
